//
//  drawingCanvas.h
//  RapidMo
//
//  Created by Michael on 10.09.09.
//  Copyright 2009 Artgruppe inc. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DrawItem.h"

//#define SHOW_DRAWING_RECT

// maximum number of stations... for the first time:
#define kMaxItems			35
#define kNotCapType 		1
#define kBorder 			3.0

@interface drawingCanvas : UIView {
	//NSMutableArray* _objectsToDraw;
	DrawItem** _objectsToDraw;

	bool _bFirstPointOfLineWasDrawn;
	int _nCount;
	//CGPoint _ptShift;
	//bool _bHaveToReadraw;
	
	int _nCurMaxSize;
	float _fLineWidth;
	
	// for creating the bounding rect of drawing image:
	CGRect _drawingRect;

	CGPoint _ptLastLine;
	//bool _bFirstPointArcAdded;
	CGPoint _ptArcLast;
	UIImageView* _viewLines;
	UIImageView* _viewCircles;
	UIImageView** _aViewAnimations;
	int 	_nAnimationsCount;

	bool _bDrawToBitmapCircles;
	bool _bDrawToBitmapLines;

	UIColor* backgroundColor;

	UIScrollView* scroll;
	UIImageView* fogView;
}
@property (nonatomic, retain) UIColor* backgroundColor;
@property (nonatomic, retain) UIScrollView* scroll;
@property (nonatomic, retain) UIImageView* _viewLines;
@property (nonatomic, retain) UIImageView* _viewCircles;

-(void) addObjectToDraw:(DrawItem*)object;
-(void) addObjecsToDraw:(DrawItem**)objects withCount:(int)count;
-(void) supplyShifting:(CGPoint)pt;
-(void) haveToDestroyBuffer;
-(void) initization;
-(void) DrawThemAll;
// private methods for drawing all the stuff into Bitmap-images:
-(void) createBitmapCircles;
-(void) createBitmapLines;
-(void) createAnimationViews;
-(void) createAnimationView:(int)indexInDB withIndexInAnimations:(int)indexAnim;
-(void) freeElements;
-(void) utilization;
-(void) setLineWidth:(float)width;
-(void) removeFog;
-(void) drawArcs: (CGContextRef) context withCap:(int)capOrNot;
-(void) drawLines: (CGContextRef) context withCap:(int)capOrNot;
@end
